projects
/
ostree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5eacc96
)
lib/deploy: skip fallocate call when requested size is 0
author
Dusty Mabe
<dusty@dustymabe.com>
Thu, 1 Jun 2023 13:23:41 +0000
(09:23 -0400)
committer
Dusty Mabe
<dusty@dustymabe.com>
Thu, 1 Jun 2023 13:25:35 +0000
(09:25 -0400)
If the requested size is 0 then of course we have enough room 🙂
This avoids the fallocate call returning an EINVAL.
Closes: #2869
src/libostree/ostree-sysroot-deploy.c
patch
|
blob
|
history
diff --git
a/src/libostree/ostree-sysroot-deploy.c
b/src/libostree/ostree-sysroot-deploy.c
index c5ced04c0aa1a3eded6331700ba7319d3801553d..d63047345683540cdb8d03affef7067be2e7a78a 100644
(file)
--- a/
src/libostree/ostree-sysroot-deploy.c
+++ b/
src/libostree/ostree-sysroot-deploy.c
@@
-2446,6
+2446,14
@@
get_kernel_layout_size (OstreeSysroot *self, OstreeDeployment *deployment, guint
static gboolean
dfd_fallocate_check (int dfd, __off_t len, gboolean *out_passed, GError **error)
{
+ /* If the requested size is 0 then return early. Passing a 0 len to
+ * fallocate results in EINVAL */
+ if (len == 0)
+ {
+ *out_passed = TRUE;
+ return TRUE;
+ }
+
g_auto (GLnxTmpfile) tmpf = {
0,
};